package ncorps.commun;

import java.io.FileNotFoundException;
import java.io.IOException;
import javax.swing.JTextArea;
import ncorps.gui.ParametersWindow;

public class NCorpsConsole {
    private CalculThread thread;

    public NCorpsConsole(ParametersWindow console, int tempsMax, double dt, int NbCorps, int _R, boolean FourierOK, boolean FimgOK, boolean FficOK, boolean newtonOK, boolean NimgOK, boolean NFicOK, String RepImages, String RepFiles, String RepStat) throws FileNotFoundException, IOException {

        int temps = 0;
        String imagenametype = "Img";
        String filenametype = "File";
        String format = "bmp";

//              TODO etat initial à part
//        FileOut.printf(_RepFiles, filenametype + "N0" + ".txt", CI.getGcoord(), _N, false);
//        FileOut.printf(_RepFiles, filenametype + "F0" + ".txt", CI.getGcoord(), _N, false);
//        new ImageOut().printi(_RepImages, imagenametype + "N0", format, CI);
//        new ImageOut().printi(_RepImages, imagenametype + "F0", format, CI);

        //Thread
        thread = new CalculThread(console, temps, dt, tempsMax, NbCorps, _R, RepImages, RepFiles, RepStat, imagenametype, filenametype, format,FourierOK, FimgOK, FficOK, newtonOK,  NimgOK, NFicOK);
        thread.start();
        AffConsole(console, tempsMax, dt, NbCorps, _R);
        
           
      
//        FileOut.printf(RepStat +"Statistiques.txt", stat);
    }

    public void AffConsole(ParametersWindow console, int tempsMax, double dt, int NbCorps, int _R) {
        JTextArea cons = console.getSortietext();
        cons.append("***********Paramètres**********" + '\n');
        cons.append("Temps Max : " + tempsMax + '\n');
        cons.append("Interval dt : " + dt + '\n');
        cons.append("Nb de Corps : " + NbCorps + '\n');
        cons.append("Rayon de la grille : " + _R + '\n');
        cons.append("***********Calculs**********" + '\n');

    }

    public CalculThread getThread() {
        return thread;
    }

    public static void main(String[] args) throws FileNotFoundException, IOException, CloneNotSupportedException {
//TODO launch console mode
    }
}








